package com.reflect;

import com.domain.Person;
import com.domain.Student;

public class ReflectDemo1 {

    public static void main(String[] args) throws Exception {
        //全类名
        Class cls = Class.forName("com.domain.Person");
        System.out.println(cls);
        //类名.class
        Class personClass = Person.class;
        System.out.println(personClass);

        Person p = new Person();
        Class aClass = p.getClass();
        System.out.println(aClass);

        System.out.println(cls==personClass);
        System.out.println(cls==aClass);

        Class studentClass = Student.class;
        System.out.println(studentClass==cls);

    }
}
